<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="10-animate.js"></script>
    <style>
        .sliderbar {
            position: absolute;
            right: 0px;
            bottom: 100px;
            background-color: rebeccapurple;
            width: 40px;
            height: 40px;
            text-align: center;
            line-height: 40px;
        }
        
        .con {
            position: absolute;
            background-color: rebeccapurple;
            width: 200px;
            top: 0px;
            left: 0px;
            z-index: -1;
        }
    </style>
</head>

<body>
    <div class="sliderbar">
        <span>←</span>
        <div class="con">问题反馈</div>
    </div>
    <script>
        var sliderbar = document.querySelector('.sliderbar');
        var con = document.querySelector('.con');
        var span = sliderbar.querySelector('span');
        console.log(sliderbar);
        console.log(con);
        // 鼠标经过sliderbar
        sliderbar.addEventListener('mouseenter', function() {
            animate(con, -160, function() {
                span.innerHTML = '→';
            });
        })

        // 鼠标离开
        sliderbar.addEventListener('mouseleave', function() {
            animate(con, 0, function() {
                span.innerHTML = '←';
            });
        })
    </script>
</body>

</html>